import 'package:flutter/material.dart';

class ImgDemo extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text("ImgDemo"),),
        body: Column(
            mainAxisAlignment: MainAxisAlignment.start,
            children: <Widget>[
              /**
               * fitCenter
               */
              Image(
                  image: NetworkImage(
                      "https://ss1.baidu.com/6ONXsjip0QIZ8tyhnq/it/u=1689110971,1914664035&fm=173&app=25&f=JPEG?w=218&h=146&s=3E1247855260D6EF141CA91803008090"),
                  width: 120,
                  height: 120,
                  fit: BoxFit.contain
              ),
              /**
               * fitXY
               */
              Image(
                  image: AssetImage("images/ic120.png"),
                  width: 120,
                  height: 60,
                  fit: BoxFit.fill
              ),
              /**
               * CenterCrop
               */
              Image(
                  image: AssetImage("images/ic120.png"),
                  width: 120,
                  fit: BoxFit.cover
              ),
              Image(
                  image: AssetImage("images/ic120.png"),
                  width: 120
              )
            ]
        )
    );
  }
}